#include <iostream>
#include "GL\glut.h"
#include "mesh_importer_exporter.h"
#include "manifold_cut_processor.h"
#include "mesh_spliter.h"
#include <gmp.h>
using namespace std;

void display()
{

}
void init ()
{
	glMatrixMode (GL_PROJECTION);
	glLoadIdentity();
	glMatrixMode(GL_MODELVIEW);
	glLoadIdentity();
}
void keyboard(unsigned char key, int x, int y)
{
	switch(key)
	{
	}
}

int main(int argc, char **argv)
{	
	object *A, *B;
	mesh_importer_exporter mesh_A_agent;
	mesh_importer_exporter mesh_B_agent;
	
	/*A = mesh_A_agent.Import("ferrari.ply");
	B = mesh_B_agent.Import("lamborghini.ply");*/
	
	A = mesh_A_agent.Import("dodecahedron.ply");
	B = mesh_B_agent.Import("icosahedron.ply");
	
	manifold_cut_processor mcp(A, B);

	mesh_A_agent.Export("meshA_after_intersection.ply");
	mesh_B_agent.Export("meshB_after_intersection.ply");

	mesh_spliter ms(mcp);
	
	glutInit(&argc, argv);
	glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB | GLUT_DEPTH);
	glutInitWindowSize (800, 600);
	glutInitWindowPosition (0, 250);
	glutCreateWindow (argv[0]);
	init ();
	//glutDisplayFunc(display);
	glutKeyboardFunc(keyboard);
	glutMainLoop();

	return 0;
}

